<?php
namespace app\api\model;

use think\Model;

class Classify extends model
{
    /**
     * 商品分类的展示
     * @return array
     * @throws \think\exception\DbException
     */
    public function index()
    {
        $info = $this->order('sort')->select();
        if(count($info)!=0)
        {
            foreach($info as $key)
            {
                $data[]=$key->toArray();
            }
            return $data;
        }
        else{
            return 0;
        }
    }
}